package com.ruoyi.fitsculpt.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.fitsculpt.mapper.EasyfitDietPlansMapper;
import com.ruoyi.fitsculpt.domain.EasyfitDietPlans;
import com.ruoyi.fitsculpt.service.IEasyfitDietPlansService;

/**
 * 饮食计划Service业务层处理
 *
 * @author metaee
 * @date 2025-02-27
 */
@Service
public class EasyfitDietPlansServiceImpl implements IEasyfitDietPlansService {
    @Autowired
    private EasyfitDietPlansMapper easyfitDietPlansMapper;

    /**
     * 查询饮食计划
     *
     * @param planId 饮食计划主键
     * @return 饮食计划
     */
    @Override
    public EasyfitDietPlans selectEasyfitDietPlansByPlanId(Long planId) {
        return easyfitDietPlansMapper.selectEasyfitDietPlansByPlanId(planId);
    }

    /**
     * 查询饮食计划列表
     *
     * @param easyfitDietPlans 饮食计划
     * @return 饮食计划
     */
    @Override
    public List<EasyfitDietPlans> selectEasyfitDietPlansList(EasyfitDietPlans easyfitDietPlans) {
        return easyfitDietPlansMapper.selectEasyfitDietPlansList(easyfitDietPlans);
    }

    /**
     * 新增饮食计划
     *
     * @param easyfitDietPlans 饮食计划
     * @return 结果
     */
    @Override
    public int insertEasyfitDietPlans(EasyfitDietPlans easyfitDietPlans) {
        easyfitDietPlans.setCreateTime(DateUtils.getNowDate());
        return easyfitDietPlansMapper.insertEasyfitDietPlans(easyfitDietPlans);
    }

    /**
     * 修改饮食计划
     *
     * @param easyfitDietPlans 饮食计划
     * @return 结果
     */
    @Override
    public int updateEasyfitDietPlans(EasyfitDietPlans easyfitDietPlans) {
        easyfitDietPlans.setUpdateTime(DateUtils.getNowDate());
        return easyfitDietPlansMapper.updateEasyfitDietPlans(easyfitDietPlans);
    }

    /**
     * 批量删除饮食计划
     *
     * @param planIds 需要删除的饮食计划主键
     * @return 结果
     */
    @Override
    public int deleteEasyfitDietPlansByPlanIds(Long[] planIds) {
        return easyfitDietPlansMapper.deleteEasyfitDietPlansByPlanIds(planIds);
    }

    /**
     * 删除饮食计划信息
     *
     * @param planId 饮食计划主键
     * @return 结果
     */
    @Override
    public int deleteEasyfitDietPlansByPlanId(Long planId) {
        return easyfitDietPlansMapper.deleteEasyfitDietPlansByPlanId(planId);
    }

    /**
     * 根据ID查询饮食计划
     * 
     * @param id 饮食计划ID
     * @return 饮食计划信息
     */
    @Override
    public EasyfitDietPlans selectEasyfitDietPlansById(Long id) {
        return easyfitDietPlansMapper.selectEasyfitDietPlansById(id);
    }
}
